package es.cea.listeners;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import es.cea.web.Stat;

/**
 * Application Lifecycle Listener implementation class EstadisticasCicloVidaApp
 *
 */
@WebListener
public class EstadisticasCicloVidaApp implements ServletContextListener {

    /**
     * Default constructor. 
     */
//	List <Stat> estadisticasApp;
    public EstadisticasCicloVidaApp() {
        // TODO Auto-generated constructor stub
//    	estadisticasApp = new ArrayList<Stat>();
    }

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0) {
        // TODO Auto-generated method stub
    	List <Stat> estadisticasApp = new ArrayList<Stat>();
//    	estadisticasApp.add(new Stat("prueba",100));
    	ServletContext servletContext = arg0.getServletContext();
    	servletContext.setAttribute("estadisticasApp", estadisticasApp);
    }

	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0) {
        // TODO Auto-generated method stub
    }
	
}
